import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: 'home',
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/home/index.vue'),
      children:[
        {
      path: 'index',
      name: 'index',
      component: () => import('@/views/home/children/index.vue'),
    },
    {
      path: 'list',
      name: 'list',
      component: () => import('@/views/home/children/list.vue'),
    },
    {
      path: 'shop',
      name: 'shop',
      component: () => import('@/views/home/children/shop.vue'),
    },
    {
      path: 'forge',
      name: 'forge',
      component: () => import('@/views/home/children/forge.vue'),
    },
    {
      path: 'my',
      name: 'my',
      component: () => import('@/views/home/children/my.vue'),
    },
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/index.vue'),
    },
    {
      path: '/detail',
      name: 'detail',
      component: () => import('@/views/detail/index.vue'),
    },
    {
      path: '/search',
      name: 'search',
      component: () => import('@/views/search/index.vue'),
    },
  ],
})

export default router
